/**
 * Project Name:springBoot-serviceImpl
 * File Name:ConsumerManyServiceImpl.java
 * Package Name:com.libra.rabbitmq.hello.serviceImp
 * Date:2018年8月18日下午4:08:07
 * Copyright (c) 2018, wangzhch All Rights Reserved.
 *
*/

package com.libra.rabbitmq.hello.serviceImp;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;
import com.libra.model.mq.Teacher;
import com.libra.rabbitmq.config.QueueConstants;

/**
 * ClassName:ConsumerManyServiceImpl <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason:	 TODO ADD REASON. <br/>
 * Date:     2018年8月18日 下午4:08:07 <br/>
 * @author   wangzhch
 * @version  
 * @since    JDK 1.8
 * @see 	 
 */
@Component
public class ConsumerManyServiceImpl {
    Logger logger = LoggerFactory.getLogger(ConsumerManyServiceImpl.class);

    @RabbitListener(queues = QueueConstants.MESSAGE_QUEUE_NAME)//@RabbitHandler
    public void handler2(@Payload Teacher teacher) {
        logger.info("B消费内容：{}", JSON.toJSONString(teacher));
    }
}

